﻿@model GameSchool.Models.ViewModels.TakeTestViewModel
@{
    ViewBag.Title = "Take Test";
}

<h2>@Model.Test.Name</h2>
<p id="StudentTestDesc">@Model.Test.Description</p>

@using(Html.BeginForm("TakeTest", "Student", FormMethod.Post))
{
    @Html.HiddenFor(model => model.StudentName)
    @Html.HiddenFor(model => model.Test.ID)

    foreach (var question in Model.Questions)
    {
        <fieldset id="TestQuestions">
            <p>@question.Question (@question.Points)</p>
            <ul>
            @foreach (var answer in Model.Answers)
            {
                if (answer.QuestionID == question.ID)
                {
                    <li><input type="radio" value="@answer.ID" name="@question.Question" />@answer.Answer</li>
                }
            }
            </ul>
        </fieldset>
    }
    <input class="SaveChanges" type="submit" value="Skila" />
}